package com.noble.glamour.bean.config;

import com.noble.glamour.bean.config.base.Action;
import com.noble.library.base.bean.BaseData;

import org.json.JSONObject;

/**
 * 在线配置
 * Created by ZRP on 2017/4/14.
 */
public class CommonConfig extends BaseData {

    public static final String STATIC_CONFIG_FILE = "static_config.json";

    private Action action;              // 活动推送配置

    @Override
    public void parseJson(String jsonStr) {
        JSONObject jsonObject = getJsonObject(getJsonObject(jsonStr).optString("res"));

        action = new Action();
        action.parseJson(jsonObject.optString("web_activity_config"));
    }

    public Action getAction() {
        return action == null ? new Action() : action;
    }

}
